function add_contract() {
    $('#detailModal2').modal();
}

function contract_submit() {

    var complete = $('#plandata-complete').val();
    var contract = $('#plandata-contract').val();
    var type = $('#plandata-type option:selected').val();

    console.log(contract);

    var url = 'create';
    var data = {
        'complete': complete,
        'contract': contract,
        'type': type
    };

    $.ajax({
        async: false,
        cache: false,
        type: 'POST',
        url: url,// 请求的action路径
        dataType: 'json',
        data: data,
        error: function () {// 请求失败处理函数
            $('#close_modal').click();
        },
        success: function (result) {
            $('#close_modal').click();
            location.href = "/plan-data/view";
        }
    });
}

function edit_contract(obj) {
    var contract_id = obj.attr('contract_id');
    var complete = obj.attr('complete');
    var contract = obj.attr('contract');
    var contract_type = obj.attr('contract_type');

    $('#plandata-complete').val(complete);
    $('#plandata-id').val(contract_id);
    $('#plandata-contract').val(contract);
    $('#plandata-type').val(contract_type);
    $('#detailModal1').modal();
}

function contract_update() {

}